/*--------------------------------------------------------------------------------
file: MsgRounter.h
use	: 封装一个消息路由类,。 根据消息cmd， 把消息发给不同对象
ver :
	1.0 by whc. at 2016-3-20. anything call me.
memo:
--------------------------------------------------------------------------------*/

#ifndef MSGROUNTER_H
#define MSGROUNTER_H

#include "../Frame/Message.h"
#include "../Frame/Client.h"
#include "System/Login.h"
#include "System/ServerInfo.h"
#include "System/ClientInfo.h"

#include <iostream>
#include <map>

using namespace std;

class MsgRounter
{
	public:
		MsgRounter();
		~MsgRounter();

		void ServerRounter(Message* _pMsg);

		void ServerInit();

		void ServerAllRegister();

	protected:
	private:
		bool m_isInit;
		typedef void (*pFunc)(Message* _pMsg);
		std::map<eCmd, pFunc> m_MsgCallMap;


};

#endif // MSGROUNTER_H
